<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateImagesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
        if (!Schema::hasTable('images')) {
            //图片表
            Schema::create('images', function(Blueprint $table)
            {
                $table->increments('id')->comment('图片的标识');
                $table->unsignedInteger('file_id')->comment('文件标识');
                $table->unsignedInteger('file_100px_id')->default(0)->comment('文件100px标识');
                $table->unsignedInteger('file_300px_id')->default(0)->comment('文件300px标识');
                $table->unsignedInteger('file_1000px_id')->default(0)->comment('文件1000px标识');
                $table->string('img_name')->nullable()->comment('图片名');
                $table->string('img_type')->nullable()->comment('图片类型');
                $table->softDeletes();
                $table->timestamps();
            });
        }

	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
	}

}
